package com.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dto.DeptDto;
import com.mapper.DeptMapper;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public class DeptMapperService {

    private final DeptMapper deptMapper;

    public DeptMapperService(DeptMapper deptMapper) {
        this.deptMapper = deptMapper;
    }

    @Transactional
    public void addDept(DeptDto deptDto) {
        deptMapper.addDept(deptDto);
    }

    public List<DeptDto> page() {
        return deptMapper.page();
    }
}
